let add = (x: number, y: number, z?: number): number => {
    if (typeof z === "number") {
        return x + y + z
    } else {
        return x + y
    }

}

interface ISum {
    (x: number, y: number, z?: number): number
}

let add2: ISum = add


let result = add(2, 3)
console.log(result);

function display(value: string): void;
function display(value: number): void;
function display(value: string | number): void {
    console.log(value);
}

display("Hello"); // OK
display(42); // OK

